package easy.id_0_100;

public class lee28 {
    public static void main(String[] args) {
        String  s1="a";
        String s2="a";
        int re = strStr(s1, s2);
        System.out.println(re);
    }

    //暴力
    public static int strStr(String haystack, String needle) {
        int len=needle.length();
        for(int i=0;i+len<=haystack.length();i++){
            String str=haystack.substring(i,i+len);
            if(str.equals(needle)){
                return i;
            }
        }
        return -1;
    }
}
